<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();  
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html>
<head>
	<base href="<%=basePath%>">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>历史记录</title>
</head>

<body>
	<section>
		<div class="row">
    	<div class="col-md-12">
       		<ul class="breadcrumb">
            <li><a href="NyglSystem/index.jsp">能源管理系统</a>
            </li>
            <li>能源管控</li>
            <li><a href="javascript:void(0);" onclick="alerts();">故障预警</a></li>
            <li><a href="javascript:void(0);">历史记录</a></li>
            </ul>
       </div>
       </div>
		<div style="width:800px; margin:50px auto;">
			<table class="table table-bordered table-hover">
				<thead>
					<tr>
						<th>序号</th>
						<th>预警设备</th>
						<th>预警等级</th>	
						<th>预警类型</th>
						<th>预警内容</th>
						<th>预警时间</th>
						<th>预警状态</th>
					</tr>
				</thead>
				<tbody>
					<c:if test="${list != null}">
					<%  int num = (Integer)request.getAttribute("currPage");
		    			int i= (num-1)*5; %>
					<c:forEach items="${list}" var="item"> 
					<tr> 
						<% i++; %>
		    			<td><%= i %></td>
						<td>${item.deviceNum}</td>
						<td>${item.rankName}</td>
						<td>${item.typeName}</td>
						<td>${item.content}</td>
						<td>${item.time}</td>
						<td>${item.status}</td>
					</tr>
					</c:forEach>
					</c:if>
				</tbody>
				<tfoot>
	            <tr>
	                <td colspan="7">
	                <div class="pagination">
	    			<a href="javascript:void(0);" onclick="alert_view(1)">第一页</a>
	    			<a href="javascript:void(0);" onclick="alert_view(${currPage-1})">上一页</a>
	    			<a href="javascript:void(0);" onclick="alert_view(${currPage+1})">下一页</a>
	    			<a href="javascript:void(0);" onclick="alert_view(${totalPage})">最末页</a>
	    			${currPage}/${totalPage}页,共${totalRows}个项目
	    			</div>
	    			</td>
	            </tr>
	        	</tfoot>
			</table>
		</div>
	</section>
</body>
</html>